package com.qf.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
public class LoginController {
    /**
     * {"code":1,"msg":"ok"}
     */
    @RequestMapping("/login")
    public HashMap<String,String> login(String username,String pwd){
        System.out.println(username);
        System.out.println(pwd);
        HashMap<String, String> map = new HashMap<>();
        //判断用户名密码是否正确
        if ("lisi".equals(username)&&"123456".equals(pwd)){
            map.put("code","1");
            map.put("msg","ok");
        }else {
            map.put("code","-1");
            map.put("msg","error");
        }
        return map;
    }
}
